import { useModel } from "umi";
import { useReactive } from "ahooks";

const useUpdateVersionDesc = () => {
    const { remoteData } = useModel("global");

    const state = useReactive({
        submitLoading: false,
    });

    const updateApplicationVersionDesc = async (params, callback) => {
        state.submitLoading = true;
        let res = await remoteData({
            object: "bnt-application-resource-center-service",
            serviceName: "/developer/person/application/updateVersionDescription",
            params,
        });
        res && callback && callback(res);
        state.submitLoading = false;
    };

    return { ...state, updateApplicationVersionDesc };
};

export default useUpdateVersionDesc;
